import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JPanel;

import static org.lwjgl.opengl.GL11.*;
import static org.lwjgl.opengl.GL12.*;
import static org.lwjgl.opengl.GL13.*;
import static org.lwjgl.opengl.GL20.*;

public class GUI extends JFrame{

	private JButton playButton;
	private JButton moveButton;
	public GUI() {
		setBounds(400, 600, 400, 300);
		playButton = new JButton("Play");
		moveButton = new JButton("Move");
		initializeListeners();

		JPanel hellYea = new JPanel(new FlowLayout());
		hellYea.add(playButton);
		hellYea.add(moveButton);
		getContentPane().add(hellYea);
		this.setVisible(true);
	}

	public void initializeListeners() {
		playButton.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent ev){
				if(playButton.getText().equals("Play")) {
					Thread test = new GLSwingTest();
					test.start();
					playButton.setText("Pause");
				} else {
					System.out.println("Stop the simulation");
					GLSwingTest.closeWindow();
				}
			}
		});

		moveButton.addActionListener(new ActionListener(){
			public void actionPerformed(ActionEvent ev){
				GLSwingTest.moveForwardButtonTest();
				//playButton.setText("Pause");
			}


		});
	}

	//	public static void main(String[] args) {
	//		GUI gui = new GUI();

	//}
}
